package com.javaee.service.impl;

import com.javaee.dao.ActivitiesDao;
import com.javaee.entity.Activity;
import com.javaee.service.ActivitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivitiesServiceImpl implements ActivitiesService {
    @Autowired
    private ActivitiesDao activitiesDao;
    @Override
    public boolean create(Activity activity) {
        return activitiesDao.create(activity)>0;
    }

    @Override
    public boolean update(Activity activity) {

        return activitiesDao.update(activity)>0;
    }

    @Override
    public boolean publish(int id) {
        return activitiesDao.publish(id)>0;
    }

    @Override
    public List<Activity> getByStatus(int status) {
        return activitiesDao.getByStatus(status);
    }

    @Override
    public List<Activity> getByName(String name) {
        return activitiesDao.getByName(name);
    }
}
